from django.db import models

# Create your models here.

'''文章模型定义'''

class UserInfo(models.Model):
    name = models.CharField(max_length=32)
    password = models.CharField(max_length=16,null=True, blank=True)
    size = models.IntegerField()
    age = models.IntegerField(default=2)
    data = models.IntegerField(null=True, blank=True)

class Article(models.Model):
    # id
    article_id = models.AutoField(primary_key=True)
    # 标题
    title = models.TextField()
    # 摘要
    brief_content = models.TextField()
    # 内容
    content = models.TextField()
    # 发布日期
    publish_date = models.DateTimeField(auto_now=True)

    def __str__(self):
        return self.title
